package memento.generalv1;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/12/1
 * @Modified By:
 */
public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        Originator tem = new Originator();
        tem.setState("中国");
        tem.setState1("英国");
        tem.setState2("美国");
        System.out.println(tem);
        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(tem.createMemento());
        tem.setState("中国1");
        tem.setState1("英国2");
        tem.setState2("美国3");
        System.out.println(tem);
        tem.restoreMemento(caretaker.getMemento());
        System.out.println(tem);
    }
}
